package org.blogwu.learn.temp.proxy.cglib;

import net.sf.cglib.proxy.Enhancer;
import org.blogwu.learn.temp.proxy.cglib.service.OrderServiceImpl;

public class Main {
    public static void main(String[] args) {
        CglibProxy cglibProxy = new CglibProxy();
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(OrderServiceImpl.class);
        enhancer.setCallback(cglibProxy);
        OrderServiceImpl orderService = (OrderServiceImpl) enhancer.create();
        orderService.placeOrder("No123123123");
    }
}
